<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <link rel="icon" th:href="@{https://v3.bootcss.com/favicon.ico}">
    <title>员工列表</title>
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
</head>

<body>

<div th:insert="~{commons/commons::topbar}"></div>
<div class="container-fluid">
    <div class="row">
        <div th:insert="~{commons/commons::sidebar(active = 'list.html')}"></div>


        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">添加员工</h1>

            <form method="post" th:action="@{/emp}">
                <div class="form-group">
                    <label for="1">用户名</label> <input class="form-control" id="1"
                                                      name="lastName" placeholder="用户名" type="text">
                </div>

                <div class="form-group">
                    <label for="b">Email</label> <input class="form-control"
                                                        id="b" name="email" placeholder="Email" type="email">
                </div>

                <div class="form-group">
                    <label for="1">用户名</label>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" name="gender" type="radio"
                               value="1"> <label for="1">男</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" name="gender" type="radio"
                               value="0"> <label for="1">女</label>
                    </div>
                </div>

                <div class="form-group">
                    <label for="1">部门</label> <select class="form-control"
                                                      name="department.id">
                    <!--在controller接受的是一个employee，所以我们需要提交的是其中的一个属性  -->
                    <option th:each="dept : ${departments}"
                            th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
                </select>
                </div>

                <div class="form-group">
                    <label for="e">出生日期</label> <input class="form-control"
                                                       id="e" name="birth" placeholder="2010-10-10"
                                                       type="text">
                </div>
                <button class="btn btn-default" type="submit">添加</button>
            </form>
        </div>
    </div>

</div>
</body>
</html>